import { defHttp } from "@/utils/http";

// ERP 用法 VO
export interface UsageVO {
	name: string; // 用法名称
	sqNumb: number; // 序号
	abbr: string; // 缩写
	grpId: number; // 分组
}

// ERP 用法 API
export const UsageApi = {
	// 查询用法分页
	getUsagePage: async (params: any) => {
		return await defHttp.get({ url: `/whs/use-method/page`, params });
	},

	// 查询用法详情
	getUsage: async (id: number) => {
		return await defHttp.get({ url: `/whs/use-method/get?id=` + id });
	},

	// 新增用法
	createUsage: async (data: UsageVO) => {
		return await defHttp.post({ url: `/whs/use-method/create`, data });
	},

	// 修改用法
	updateUsage: async (data: UsageVO) => {
		return await defHttp.put({ url: `/whs/use-method/update`, data });
	},

	// 删除用法
	deleteUsage: async (id: number) => {
		return await defHttp.delete({ url: `/whs/use-method/delete?id=` + id });
	},

	// 导出用法 Excel
	exportUsage: async (params: any) => {
		return await defHttp.download({ url: `/whs/use-method/export-excel`, params });
	}
};
